﻿@{
    ViewBag.Title = "Index";
}

@this.RefStyle("~/Content/wdtree/tree.css")
@this.RefScript("~/Content/wdtree/tree.js")
@this.Partial("Index_js")

<div style="max-width:1000px;">
    <div class="topPanel">
        <div class="toolbar">
            <a class="a-btn-refresh" onclick="$ace.reload()"></a>
            <button class="a-btn-edit" data-bind="click:edit,disable:!dataTable.selectedModel()">修改</button>
            <button class="a-btn-add" data-bind="click:add">添加</button>
            <button class="a-btn-delete" data-bind="click:del,disable:!dataTable.selectedModel()">删除</button>
            <!--<button class="a-btn-primary fa fa-eye" data-bind="click:assignPermission,attr:{disabled:!dataTable.selectedModel()}">权限设置</button>-->
        </div>
        <div class="search">
            <table class="form-table" style="width:400px;">
                <tr>
                    <td>
                        <input type="text" class="a-control" placeholder="请输入要查询关键字" style="width: 200px;" data-bind="value:searchModel().keyword">
                    </td>
                    <td>
                        <button type="button" class="a-btn-search" data-bind="click:search"></button>
                    </td>
                </tr>
            </table>
        </div>
    </div>


    <div>
        <table class="table table-hover" data-bind="with:dataTable">
            <thead>
                <tr>
                    <th style="width:20px;"></th>
                    <th>编号</th>
                    <th>会员等级</th>
                    <th>月费</th>
                    <th>月天数</th>
                    <th>年费</th>
                    <th>年天数</th>
                    <th>状态</th>
                </tr>
            </thead>
            <tbody data-bind="foreach:models">
                <tr data-bind="click:$parent.selectRow">
                    <td data-bind="text:$parent.getOrdinal($index())"></td>
                    <td data-bind="text:ID"></td>
                    <td data-bind="text:RoleName"></td>
                    <td data-bind="text:MonthFee"></td>
                    <td data-bind="text:MonthDays"></td>
                    <td data-bind="text:YearFee"></td>
                    <td data-bind="text:YearDays"></td>
                    <td data-bind="text:$ace.findName(_sts,ST(),'id','text')"></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<dialogbox data-bind="with:dialog">
    <form id="form1">
        <table class="form-table">
            <tr>
                <td class="form-title">等级名称</td>
                <td class="form-value">
                    <input name="RoleName" type="text" class="a-control required" placeholder="请输入等级名称" data-bind="value:model().RoleName" />
                    <input name="ID" type="hidden" class="a-control required" data-bind="value:model().ID" />
                </td>
            </tr>
            <tr>
                <td class="form-title">月费</td>
                <td class="form-value">
                    <input name="MonthFee" type="text" class="a-control required" placeholder="请输入月费" data-bind="value:model().MonthFee" />
                </td>
            </tr>
            <tr>
                <td class="form-title">月天数</td>
                <td class="form-value">
                    <input name="MonthDays" type="text" class="a-control required" placeholder="请输入月天数" data-bind="value:model().MonthDays" />
                </td>
            </tr>

            <tr>
                <td class="form-title">年费</td>
                <td class="form-value">
                    <input name="YearFee" type="text" class="a-control required" placeholder="" data-bind="value:model().YearFee" />
                </td>
            </tr>
            <tr>
                <td class="form-title">年天数</td>
                <td class="form-value">
                    <input name="YearDays" type="text" class="a-control required" placeholder="" data-bind="value:model().YearDays" />
                </td>
            </tr>
            <tr>
                <td class="form-title">年天数</td>
                <td class="form-value">
                    <select class="a-control" name="ST" id="ST" data-bind="options:_sts,optionsText:'text',optionsValue:'id',optionsCaption:'--选择--',value:model().ST"> </select>
                </td>
            </tr>

        </table>
    </form>
</dialogbox>

<dialogbox data-bind="with:permissionDialog">
    <form id="form-permission">
        <div id="permissionTree"></div>
    </form>
</dialogbox>
